function loadPage(url){ 
		$("#contenido").fadeOut("slow", function(){
            $("#contenido").load(url, function(){
                $("#contenido").fadeIn("slow");
            });
        });
}

/*------------------------------- SLIDER ------------------------------------*/

function cargarContenido(id_div){
 		 var capas = document.getElementById(id_div).querySelectorAll('img');
		 for (var i=0; i < capas.length; i++){
		 	 /* Muestra solo la primera imagen */
			 if (i == 0){
			 	capas[i].style.visibility='visible';
				capas[i].style.display='inline';
			 }else {
			 	   capas[i].style.visibility='hidden';
				   capas[i].style.display='none';
			 }
	     }
}
function siguiente(id_div){
		 var capas = document.getElementById(id_div).querySelectorAll('img');
		 for (var i=0; i < capas.length; i++){
		 	 
			 if (capas[i].style.visibility == 'visible'){
			 	var ind = i+1;
				if (ind >= capas.length){
				  ind = 0;
				}
				
				capas[ind].style.visibility='visible';
				capas[ind].style.display='inline';

			 	capas[i].style.visibility='hidden';
				capas[i].style.display='none';
				break;
			 }
	     }
}
function anterior(id_div){
		 var capas = document.getElementById(id_div).querySelectorAll('img');
		 for (var i=0; i < capas.length; i++){
		 	 
			 if (capas[i].style.visibility == 'visible'){
			 	var ind = i-1;
				if (ind < 0){
				  ind = capas.length - 1;
				}
				capas[ind].style.visibility='visible';
				capas[ind].style.display='inline';
			 	
			 	capas[i].style.visibility='hidden';
				capas[i].style.display='none';
				break;
			 }
	     }
}
/*--------------------------- SLIDER ------------------------------------------*/

function showPopup(){
  document.getElementById('modal_fondo').style.visibility='visible';
  $("#modal_contenido").show("slow");
}
function ocultarDiv(id){
  $(id).hide();
}